package gui.component;

import database.entity.ContactGroup;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

/**
 *
 * @author Tom
 */
public class ContactGroupRenderer implements ListCellRenderer<ContactGroup>
{

    @Override
    public Component getListCellRendererComponent(JList<? extends ContactGroup> jlist, ContactGroup e, int i, boolean isSelected, boolean bln1)
    {
        JLabel result = new JLabel(e.groupName);        
        result.setOpaque(true);
        //result.set
        if (isSelected)
        {            
            result.setBackground(Color.WHITE);
            result.setForeground(Color.RED);
            result.setFont(new Font("Calibri",Font.BOLD,20));
        }
        else
        {
            result.setFont(new Font("Calibri",Font.PLAIN,20));
        }
        return result;
    }
    
}
